package com;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Address;
import akka.actor.Deploy;
import akka.actor.Props;
import akka.kernel.Bootable;
import akka.remote.RemoteScope;

import com.typesafe.config.ConfigFactory;

public class ServerApp implements Bootable{

	ActorSystem system;
	ActorRef serverActor;
	
	ServerApp(){
		System.out.println("nimab    *************************** begin Server");
		system = ActorSystem.create(Server.AkkaSystemName,ConfigFactory.load().getConfig("server"));
		Address addr = new Address("akka",Server.AkkaSystemName,"127.0.0.1",25452);
		serverActor = system.actorOf(new Props(Server.class).withDeploy(new Deploy(new RemoteScope(addr))),"simple");
		System.out.println("nimab    *************************** end Server");
	}
	
	@Override
	public void shutdown() {
		system.shutdown();
		
	}

	@Override
	public void startup() {
		
	}
	
	public static void main(String[] args) {
		ServerApp sa = new ServerApp();

	}

}
